package com.group5.onlinegame.service;

import com.group5.onlinegame.dao.IAnnouncementDao;
import com.group5.onlinegame.entity.Announcement;
import com.group5.onlinegame.entity.AnnouncementType;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class AnnouncementService implements IAnnouncementService {

    @Resource
    private IAnnouncementDao announcementDao;

    @Override
    public List<Announcement> getAnnouncement() {
        return announcementDao.getAnnouncement();
    }

    @Override
    public Integer delAnnouncement(Integer id) {
        return announcementDao.delAnnouncement(id);
    }

    @Override
    public List<AnnouncementType> getAnnouncementType() {
        return announcementDao.getAnnouncementType();
    }

    @Override
    public Integer createNewAnnouncement(Announcement announcement) {
        return announcementDao.createNewAnnouncement(announcement);
    }

    @Override
    public Integer updateAnnouncement(Announcement announcement) {
        return announcementDao.updateAnnouncement(announcement);
    }

    @Override
    public Announcement getOneAnnouncement(Integer id) {
        return announcementDao.getOneAnnouncement(id);
    }
}
